// JavaScript Document

$(function(){
	var winH = $(window).height();
	var winW = $(window).width();
	var rightBgW = Math.ceil(winW*0.35);
	var num = 1280;
	var numS = 1024;
	//alert(rightBgW);
	
	bgW(winW);
	
	
	$(window).resize(function()
	{
		var changW = $(this).width();
		
		if(winW != changW)
		{
			bgW(changW);	
		}
		else
		{
			bgW(winW);	
		}
    });
	
	function bgW(w)
	{
		
		if( w>=1660)
		{
			$(".right_bg").width(760);
			$(".cont").css("right","140px");
		}
		else if( w <= num && w >numS )
		{
			
			rightBgW = Math.ceil(w*0.5);
			$(".right_bg").width(rightBgW+"px");
			$(".cont").css("right","70px");
		}
		else if ( w <= numS )
		{
			rightBgW = Math.ceil(w*0.6);
			$(".right_bg").width(rightBgW+"px");
			$(".cont").css("right","45px");	
		}
		else
		{
			rightBgW = Math.ceil(w*0.5);
			$(".right_bg").width(rightBgW+"px");
		}
	}
	
});
